Skip to content

docs(rfc): RFC-0040 first-class collections - #83

Merged
Madraka merged 2 commits into
mainfrom
rfc/first-class-collections
Oct 22, 2026
Merged

Madraka merged 2 commits into
mainfrom
rfc/first-class-collections

Conversation

@Madraka

@Madraka Madraka commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

RFC only, no code. Makes collections first-class (#71), in stages. Stage 1 is fully specified; stages 2 and 3 are sketched.

Stage 1 decisions to review (open questions have recommended defaults):

  • Contract: Site.collections.<key> gains optional fields: labels (per locale, singular and plural), icon (from a closed set), feed, sitemap and sort. There is a cap of 50 collections. Everything is optional, so there is no schemaVersion bump. pnpm gen was checked against the diff for both TypeScript and Rust.

  • Registry: inferred, not migrated. It holds the declared keys, every collection that has entries, and posts. No site node is rewritten. A collection becomes declared on its first settings save or through create_collection.

  • Not duplicated: taxonomies stay on Taxonomy.collections and comments stay in comment_settings (outside the graph, RFC-0007). The collection screen edits each where it is stored.

  • Store:

    • keys are immutable;
    • a collection can be undeclared only when it is empty;
    • the first entry of a new collection gets its default prefix checked for overlaps (path_conflict). This closes RFC-0038's gap.
    • The store itself does not require a declaration, so push, import and seed keep working.
  • Studio: each collection gets a sidebar entry and its own CollectionPage, generalised from ArticlesPage. There is a settings tab and a "New collection" dialog, and /articles redirects to the new route.

  • MCP:

    • list_collections;
    • create_collection and update_collection, both with approval and approverScopes: ["site:settings"];
    • create_entry refuses collections outside the registry.

    Existing sites are unaffected, because their collections are inferred.

  • Themes: only new exports are added (collectionLabel, collectionSettings). The default feed and sitemap output is unchanged, and the old-theme test stays green.

Rollout after acceptance (one PR each, as in RFC-0038): contract → store/API → Studio → MCP.

Refs #71

🤖 Generated with Claude Code

Stage 1 fully specified: Site.collections becomes a declared registry
(labels per locale, icon, feed, sitemap, default sort next to the
permalink), inferred from existing entries with no data migration;
Studio list screen per collection and a New collection flow; MCP
list_collections, create_collection and update_collection behind
approval with approverScopes site:settings; create_entry refuses
unregistered collections; a new collection's default prefix is checked
for overlaps (closes RFC-0038's gap). Stages 2 (typed custom fields)
and 3 (JSON-LD presets, expiry automations, references) sketched.

Refs #71

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka Madraka added the rfc A design proposal in docs/rfcs label Oct 22, 2026
@Madraka
Madraka enabled auto-merge October 22, 2026 18:50
@Madraka
Madraka merged commit 3141186 into main Oct 22, 2026
4 checks passed
@Madraka
Madraka deleted the rfc/first-class-collections branch October 22, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfc A design proposal in docs/rfcs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant